The present invention relates to a dynamic file expansion method and system for information management systems of the type that the total amount of data in a file and the amount of expected data increase during a unit time period cannot be estimated beforehand, particularly for on-line database systems in which storage and reference of a great amount of data is executed by a plurality of database systems.
When the space of a file becomes insufficient due to repetitive data storage such as data addition and insertion, a file management system informs an application program of an insufficient file space error so that the job executed by the application program is intercepted. The file manager disconnects the file from on-line jobs to expand and reallocate the space and thereafter store data again, or to provide additional space allocation. Such file expansion requires interception of on-line jobs. It is therefore necessary to always monitor the use state of a file and estimate the amount of expected data increase, to accordingly expand the file space at a proper time, such as at night. Such management is cumbersome and requires a large amount of labor. Furthermore, due to service time needed for on-line jobs being provided in the night and on holidays it is not always possible to perform file expansion.
In a known method, a file management system automatically expands a file by a predetermined amount when the empty space of the file becomes insufficient or before it becomes insufficient. For example, according to a method proposed in JP-A-2-61732, a threshold value of a file use factor and a medium name to be automatically expanded are registered in advance to thereby automatically provide an additional space when the file is used in excess of the threshold value. More specifically, file expansion without intercepting on-line jobs is realized by provision of means for automatically supervising the use state of the file and automatically expanding the file when the file is used in excess of the threshold value a file use factor set at the time of file allocation, or by provision of means for dynamically inquiring a need of file expansion and means for dynamically instructing file expansion.
With such a conventional approach, a record input/output processing for a file is performed while referring to file space management information stored in a memory. Therefore, during the file expansion which causes the space management information to change, all record input/output processing for the file is stopped. The wait state of the jobs using this file occurs temporarily during the file expansion, lowering the on-line response.
There is another approach of allocating an additional file and handles a plurality of files as a single logical file. With this approach, it is possible to allocate an additional file while continuing record input/output processing by using already existing files. However, the number of physical files increases each time file expansion is performed. The memory capacity used for management of files and the number of file open processes therefore increase, leading to complicated file management. Furthermore, if file expansion is performed basing upon a record store instruction or file expansion instruction in the course of executing an application program, an overhead of the file expansion is added to the job execution process, lowering the response of the job.
Apart from the above, if timings for file expansion are judged from a threshold value of a file use factor, the following problems arise.
Namely, although the total file space increases by file expansion, if an allocated expansion space is small relative to the empty space left at the time when the file is used up to the threshold value, timings for starting file expansion become faster the more the file expansion is performed, occupying wasteful space generated by the file expansion otherwise unnecessary. On the contrary, if an allocated expansion space is large relative to the empty space remaining at the time when the file is used up to the threshold value, there is an ample possibility of using entirely the remaining empty space before completion of the file expansion.
If a file is shared by a plurality of file management systems, the following problems occur.
Namely, space management information of the file expanded by a certain management system contradicts with that of another file management system. In this case, records within the expanded space cannot be accessed, or the already expanded file is again expanded unnecessarily.
If there is some failure of a dynamically expanded file or dynamic file expansion process itself, the following problems occur.
Namely, a file management system is generally provided with a file recovery means for recovering a file by inputting history (journal) information containing the later renewal, addition, and deletion of records, to a file backup copy, and reproducing time sequentially the renewal, addition, and deletion of the records. It is also necessary to recover a file which underwent dynamic file expansion, by using a similar file recovery means. Furthermore, if the whole space of a file is made unusable when some failure occurs while expanding the file, jobs using the space before the file expansion are stopped.